package com.kinghood.authoritycenter.common.model.dto.organization;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kinghood.sharding.model.KingHoodDefaultSort;
import com.kinghood.sharding.model.KingPageReqDTO;
import lombok.Data;

import java.io.Serializable;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * description
 *
 * @author zhangFanJun
 * @date 2023-12-18 17:54
 **/
@Data
public class SysLogQueryReqDTO extends KingPageReqDTO implements KingHoodDefaultSort, Serializable {

    private static final long serialVersionUID = 1L;
    public static final String DEFAULT_COLUMN = "createTime";
    public static final String DEFAULT_Tail = "id";

    @Override
    public List<OrderItem> getDefaultSort() {
        OrderItem one = OrderItem.desc(DEFAULT_COLUMN);
        return Collections.singletonList(one);
    }

    @Override
    public List<OrderItem> getTailSort() {
        OrderItem one = OrderItem.asc(DEFAULT_Tail);
        return Collections.singletonList(one);
    }

    /**
     * 操作人名称
     */
    private String userName;
    /**
     * 归属类型（0：组织中心，1，商品中心）
     */
    private Integer belongType;
    /**
     * 模块
     */
    private Integer module;
    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;
    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

}
